home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 4: GNU Archives / Linux Cubed Series 4 - GNU Archives.iso / gnu / fontutil.6 / fontutil / fontutils-0.6 / imageto / ifi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-02  |  2.6 KB  |  92 lines

  1. /* ifi.h: information about the characters in the image.
  2.  
  3. Copyright (C) 1992 Free Software Foundation, Inc.
  4.  
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #ifndef IFI_H
  20. #define IFI_H
  21.  
  22. #include "types.h"
  23.  
  24.  
  25. /* See ifi.c.  */
  26. extern string encoding_name, ifi_filename;
  27.  
  28.  
  29. /* A single character in the image.  */
  30. typedef struct 
  31. {
  32.   charcode_type charcode;
  33.   string charname;
  34.   boolean omit;
  35.   int baseline_adjust;
  36.   unsigned bb_count;
  37.   boolean alternating;
  38.   int lsb, rsb;
  39. } image_char_type;
  40.  
  41. /* The character code.  This is garbage if `omit' is true.  */
  42. #define IMAGE_CHARCODE(c) ((c).charcode)
  43.  
  44. /* The character name.  */
  45. #define IMAGE_CHARNAME(c) ((c).charname)
  46.  
  47. /* Says whether this character should be output.  */
  48. #define IMAGE_CHAR_OMIT(c) ((c).omit)
  49.  
  50. /* How far the baseline should be moved from the row's baseline.  */
  51. #define IMAGE_CHAR_BASELINE_ADJUST(c) ((c).baseline_adjust)
  52.  
  53. /* How many bounding boxes comprise this character.  */
  54. #define IMAGE_CHAR_BB_COUNT(c) ((c).bb_count)
  55.  
  56. /* Says whether the bounding boxes in this character are consecutive
  57.    (the usual case) or alternate.  */
  58. #define IMAGE_CHAR_BB_ALTERNATING(c) ((c).alternating)
  59.  
  60. /* The side bearings.  */
  61. #define IMAGE_CHAR_LSB(c) ((c).lsb)
  62. #define IMAGE_CHAR_RSB(c) ((c).rsb)
  63.  
  64.  
  65. /* A list of the above.  */
  66. typedef struct
  67. {
  68.   image_char_type *data;
  69.   unsigned length;
  70. } image_char_list_type;
  71.  
  72. /* The Nth element of the list L.  */
  73. #define IMAGE_CHAR(l, n) ((l).data[n])
  74.  
  75. /* The list as a whole.  */
  76. #define IMAGE_CHAR_LIST_DATA(l) ((l).data)
  77.  
  78. /* The length of the list.  */
  79. #define IMAGE_CHAR_LIST_LENGTH(l) ((l).length)
  80.  
  81.  
  82. /* Read the IFI file IFI_FILENAME. Return the total number of characters
  83.    read in TOTAL_COUNT.  */
  84. extern image_char_list_type read_ifi_file (unsigned *total_count);
  85.  
  86. /* Return false if the box BOX_COUNT boxes beyond FIRST_CHAR in LIST
  87.    is in the middle of a character, true otherwise.  */
  88. extern boolean box_at_char_boundary_p
  89.   (image_char_list_type list, unsigned first_char, unsigned box_count);
  90.  
  91. #endif /* not IFI_H */
  92.